﻿#ifndef VertexBuffer_h
#define VertexBuffer_h

#include <Defines.h>
#include <Typedef.h>
#include <CSharpPropertyMethods.h>

#include <System/Object.h>
#include <System/IDisposable.h>
#include <System/ArgumentNullException.h>
#include <System/InvalidOperationException.h>
#include <System/NotSupportedException.h>
#include <System/ArgumentOutOfRangeException.h>
#include <System/Array.h>

#include "../GraphicsResource.h"
#include "BufferUsage.h"
#include "VertexDeclaration.h"
#include "../SetDataOptions.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Graphics
			{
	            class VertexBuffer
					: public GraphicsResource
                {
                    protected: bool _isDynamic;

            #if DIRECTX
                    public: /*internal*/ SharpDX.Direct3D11.VertexBufferBinding _binding;
                    protected: SharpDX.Direct3D11.Buffer _buffer;
            #elif PSM
                    public: /*internal*/ Array _vertexArray;
            #else
		            //public: /*internal*/ uint vao;
		            public: /*internal*/ uint vbo;
            #endif
	
		            public: int VertexCount; // { get; private set; }
		            public: GC_PTR<VertexDeclaration> vertexDeclaration; // { get; private set; }
		            public: BufferUsage bufferUsage; // { get; private set; }
		
		            protected: VertexBuffer(GC_PTR<GraphicsDevice> graphicsDevice, GC_PTR<VertexDeclaration> vertexDeclaration, int vertexCount, BufferUsage bufferUsage_, bool dynamic)
		            {

		            }

                    public: VertexBuffer(GC_PTR<GraphicsDevice> graphicsDevice, GC_PTR<VertexDeclaration> vertexDeclaration, int vertexCount, BufferUsage bufferUsage)
						//: this(graphicsDevice, vertexDeclaration, vertexCount, bufferUsage, false)
                    {
                        throw; // Implement this() method.
                    }
		
				    public: VertexBuffer(GC_PTR<GraphicsDevice> graphicsDevice, Riccsson::System::Type* type, int vertexCount, BufferUsage bufferUsage)
						//: this(graphicsDevice, VertexDeclaration.FromType(type), vertexCount, bufferUsage, false)
		            {
                         throw; // Implement this() method.
                    }

                    /// <summary>
                    /// The GraphicsDevice is resetting, so GPU resources must be recreated.
                    /// </summary>
                    /*internal*/ protected: override void GraphicsDeviceResetting()
                    {
						throw;
                    }

					public: template<typename T> void GetData (int offsetInBytes, Riccsson::System::Array<T>* data, int startIndex, int elementCount, int vertexStride) // where T : struct
                    {
						throw;
                    }

					public: template<typename T> void GetData(Riccsson::System::Array<T>* data, int startIndex, int elementCount) // where T : struct
                    {
						throw;
                    }

                    public: template<typename T> void GetData(Riccsson::System::Array<T>* data) // where T : struct
                    {
						throw;
                    }

                    public: template<typename T> void SetData(int offsetInBytes, Riccsson::System::Array<T>* data, int startIndex, int elementCount, int vertexStride)// where T : struct
                    {
						throw;
                    }
        		
		            public: template<typename T> void SetData(Riccsson::System::Array<T>* data, int startIndex, int elementCount) //where T : struct
                    {
						throw;
		            }
		
                    public: template<typename T> void SetData(Riccsson::System::Array<T>* data) //where T : struct
                    {
						throw;
                    }

                    protected: template<typename T> void SetDataInternal(int offsetInBytes, Riccsson::System::Array<T>* data, int startIndex, int elementCount, int vertexStride, SetDataOptions options)// where T : struct
                    {
						throw;
                    }

                    protected: override void Dispose(bool disposing)
                    {
                        GraphicsResource::Dispose(disposing);
		            }
                };
            }
		}
	}
}

#endif